package com.EAIPClub.CodeShellManager.controller;

import com.EAIPClub.CodeShellManager.service.CodeShellContentManagerService;
import com.api.POJO.CodeLab.CodeShellManager.CodeShellManagerContentReturnMsg;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/11
 */
@RestController
public class CodeShellContentManagerController {

    private CodeShellContentManagerService service;

    @Autowired
    public void setService(CodeShellContentManagerService service) {
        this.service = service;
    }

    @PostMapping("/codehsell/add/content/")
    CodeShellManagerContentReturnMsg addNewCodeShellContent(String content){
        return service.addNewCodeShellContent(content);
    }

    @GetMapping("/codeshell/get/content/{uid}")
    CodeShellManagerContentReturnMsg getCodeShellContentByUid(@PathVariable String uid){
        return service.getCodeShellContentByUid(uid);
    }

    @DeleteMapping("/codeshell/delete/content/{uid}")
    CodeShellManagerContentReturnMsg deleteCodeShellContentByUid(@PathVariable String uid){
        return service.deleteCodeShellContentByUid(uid);

    }

}
